package com.example.controller;

import com.example.entity.Student;
import com.example.service.StudentService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;


/**
 * @author kangshuai
 */
@RestController
@RequestMapping("student")
public class StudentController {

    @Resource
    private StudentService studentService;

    @GetMapping("/list")
    public List<Student> list(@RequestBody Student student) {
        return studentService.findByStudent(student);
    }

    @PostMapping("/save")
    public String save(@RequestBody Student student) {
        studentService.save(student);
        return "success";
    }
}
